package com.kma.summer2012.client.services.request;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.kma.summer2012.shared.model.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface CrumbsRequestServiceAsync {
    // void addNewRequest(UICrumbsRequest newRequest, AsyncCallback<UICrumbsRequest> async);
    void addNewRequest(UICrumbsRequest newRequest, AsyncCallback<UICrumbsRequest> async);

    void editOperatorRequest(UICrumbsRequest request, AsyncCallback<UICrumbsRequest> async);

    void getById(int id, AsyncCallback<UICrumbsRequest> async);

    void assignRequest(int user_id, int request_id, Date assignDateBegin, Date assignDateEnd, AsyncCallback<Boolean> async);

    void updateClient(UICrumbsClient client, AsyncCallback<UICrumbsClient> async);

    void getHistoryForRequest(int requestID, int commenterID, AsyncCallback<Boolean> async);

    // void lastID( AsyncCallback<Integer> async) throws SQLException;
    // void update(int id, String comments, AsyncCallback async);
    void sendchangeState(int id, String comment, int senderId, AsyncCallback<Boolean> async);

    void initialize(UICrumbsRequest request, AsyncCallback<UICrumbsRequest> async);

    void getLastCommentFromManger(UICrumbsRequest request, AsyncCallback<UICrumbsRequest> async);

    void addNewClient(UICrumbsClient newClient, AsyncCallback<UICrumbsClient> async);

    void sendForProcessing(int idSender, int idRequest, AsyncCallback<Boolean> async);

    void saveComments(UIComment comment, AsyncCallback<Boolean> async);

    void saveDate(int requestID, Date start, Date end, AsyncCallback<Integer> async);

    void updateDate(int requestID, Date start, Date end, AsyncCallback<Integer> async);

    void getAllRequests(AsyncCallback<List<UICrumbsRequest>> async);

    void getAllForUser(UICrumbsUser user, AsyncCallback<List<UICrumbsRequest>> async);

    void closeRequest(Map<UICrumbsToolItem, Integer> actualToolsAndAmount, UICrumbsRequest request, String comment, int userId, String date, AsyncCallback<Boolean> async);

    void editManagerRequest(int request_id, AsyncCallback<Boolean> async) ;

    void getAllClosed(AsyncCallback<List<UICrumbsRequest>> async);

    void deleteRequests(List<Integer> requests, AsyncCallback<Boolean> async);

    void sendAllForProcessing(int idSender, List<UICrumbsRequest> requests, AsyncCallback<Boolean> async);
}
